import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Boton here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Boton extends Actor
{
    /**
     * Act - do whatever the Boton wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private int num;
   protected int desaparece;
    public void act() 
    {
        // Add your action code here.
    }    
    public void mueve(){
        
       
        if(num==0){          
        if(getY()<360){ setLocation(getX(),getY()+4);}else{num=1;}        
        }
        
        if(num==1){    
        if(getY()>300){setLocation(getX(),getY()-4);}else{num=2;}
       }
       if(num==2){
         if(getY()<360){ setLocation(getX(),getY()+4);}      
        }
      /* if(num==2 && getY()<360){          
         setLocation(getX(),getY()+4);
        }*/
        
        
    }
    public void mouseSobreBoton(){
      if(Greenfoot.mouseMoved(this)){this.getImage().scale(160,60);}else{this.getImage().scale(150,50);}      
    }
    public Boton(){num=0;}
    
    public void desapareceBotonPlay(){
     num++;
    turn(10);   
      if(num==36){ 
           World aux=getWorld();
        ((Menu)aux).desapareceTutorial();
      
        num=0;getWorld().removeObject(this);
       
        }    
    }
     public void desapareceBotonTutorial(){
     num++;
    turn(10);   
      if(num==36){ 
           World aux=getWorld();
        ((Menu)aux).desapareceRecords();
      
        num=0;getWorld().removeObject(this);
       
        }    
    }
     public void desapareceBotonRecords(){
     num++;
    turn(10);   
      if(num==36){ 
           World aux=getWorld();
        ((Menu)aux).desaparecePlay();
      
        num=0;getWorld().removeObject(this);
       
        }    
    }
   
}
